package com.kgar.controller;


import com.kgar.dto.JobMark;
import com.kgar.dto.Result;
import com.kgar.service.JobInfoDocService;
import com.kgar.service.JobInfoService;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Nullable;
import javax.annotation.Resource;

/**
 * @author Trimb
 */
@RestController
@RequestMapping("/job")
@Lazy
public class JobController {

    @Resource
    private JobInfoService jobInfoService;

    @Resource
    private JobInfoDocService jobInfoDocService;


    @PostMapping
    public Result queryAll(@RequestParam @Nullable String orderBy) {
        return jobInfoDocService.findAll(orderBy);
    }

    @PostMapping("bestJob")
    public Result bestJob() {
        return jobInfoDocService.getBestJob();
    }

    //职业能力评估
    @PostMapping("assessment")
    public Result assessment(){
        return jobInfoDocService.getAssessment();
    }

    @PostMapping("mark")
    public Result mark(@RequestBody JobMark jobMark){
        return jobInfoService.recordScore(jobMark);
    }

    @PostMapping("getMarked")
    public Result getMarked(){
        return jobInfoService.getRecordScore();
    }

    @PostMapping("tags")
    public Result getTags(){
        return jobInfoService.queryAllTags();
    }

    @PostMapping("hotTags")
    public Result getHotTags(){
        return jobInfoService.queryHotTags();
    }


    @PostMapping("graph")
    public Result getGraph(){
        return jobInfoService.getGraph();
    }
    

}
